const api = {
  Login: '/user/login',
  UserInfo: '/user/userinfo',
  UserName: '/user/name'
}

import request from '@/utils/request'

export default api

// 付费页面埋点
export const trackingPagePv = (data) => {
  return request({
    url: '/payment/addpv',
    method: 'post',
    data,
    hideloading: true
  })
}

// 付费欲望埋点（点了yes才发送数据）
export const trackingPayment = (data) => {
  return request({
    url: '/payment/addpayment',
    method: 'post',
    data,
    hideloading: true
  })
}

export const getDiscoveryList = (data) => {
  return request({
    url: '/literature/findforindex',
    method: 'get',
    data
  })
}

export const getBookList = (data) => {
  return request({
    url: '/book/findall',
    // url: '/chapter/findall',
    method: 'post',
    data
  })
}

export const getBookDetail = (data) => {
  return request({
    url: '/book/findone',
    method: 'post',
    data
  })
}

export const getChapterList = (data) => {
  return request({
    url: '/chapter/findall',
    method: 'post',
    data
  })
}

export const getChapterDetail = (data) => {
  return request({
    url: 'chapter/findone',
    method: 'post',
    data
  })
}

export const getBookDetailById = (data) => {
  return request({
    url: '/book/findall',
    method: 'post',
    data
  })
}
